<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var xhr = new XMLHttpRequest()
        xhr.open('POST', 'http://www.liulongbin.top:3006/api/addbook')
        xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
        xhr.send('bookname=海贼王&author=路飞&publisher=日本出版社');
        xhr.onreadystatechange = function() {
            if (xhr.readystate === 4 && xhr.status === 201) {
                console.log(xhr.responseText);

            }
        }
    </script>
</body>

</html>